1. Field of the Invention
This invention is related to digital systems and, more particularly, to credit management for credit-based flow control mechanisms for interfaces in digital systems.
2. Description of the Related Art
Digital systems often include flow-controlled interfaces between integrated circuits (ICs) in the system, between systems, and sometimes even within an IC. The flow-control mechanism generally exists to prevent buffer overruns or other loss of data situations from occurring in a receiver. For example, a common flow control mechanism is credit-based. A receiver on the interface may broadcast the number of credits it has available for various types of transmissions, and a transmitter may record the credits. The transmitter can then transmit on the interface and deduct credits for each transmission. Once the credits run out, the transmitter must cease transmitting. The receiver, as it completes processing of received transmissions, frees the credits consumed by each transmission and transmits freed credits back to the transmitter.
The credits advertised by the receiver may generally be constrained by the available resources at the receiver for handling the transmissions. For example, buffers are generally provided to store received transmissions. The available buffers indicate how many credits can be advertised for each transmission type. In some cases, the buffers are implemented as a memory. If the memory cannot be allocated at the same granularity as the credits (or at a finer granularity), then inefficiencies in the use of the memory result. Generally, a full memory granule must be allocated to store any amount of data up to the full memory granule. Because data can be transmitted at less than the memory granule (or at some non-integer multiple of the memory granule), the number of credits that can be advertised is less than one might guess based on knowledge of the size of the memory. The achievable bandwidth on the interface is thus less than would be possible if the memory could be allocated with more granularity.